<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>记账应用 - 全局视图</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/iframe-view.css">
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: system-ui, -apple-system, sans-serif;
            background-color: #f5f5f7;
            overflow-x: hidden;
        }
        .main-container {
            width: 100%;
            min-height: 100vh;
            padding: 40px 0;
            box-sizing: border-box;
            position: relative;
        }
        .header-buttons {
            display: flex;
            justify-content: flex-end;
            margin-right: 40px;
            margin-bottom: 30px;
        }
        .iframe-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 40px;
            padding: 0 20px;
            width: 100%;
            box-sizing: border-box;
        }
        .iframe-box {
            width: 375px;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 40px;
        }
        .iframe-title {
            color: #444;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
            margin: 15px 0;
        }
        .iphone-mockup {
            width: 100%;
            position: relative;
            overflow: visible;
            background-color: transparent;
        }
        .iphone-frame {
            width: 100%;
            padding-top: 214%; /* 高宽比约为2.14:1，符合iPhone实际比例 */
            position: relative;
            background-color: #1a1a1a;
            border-radius: 45px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
            overflow: hidden;
        }
        .iphone-screen {
            position: absolute;
            top: 12px;
            left: 12px;
            right: 12px;
            bottom: 12px;
            background-color: white;
            border-radius: 35px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .iphone-status-bar {
            height: 44px;
            width: 100%;
            background-color: white;
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            color: #1a1a1a;
            font-size: 14px;
            font-weight: 600;
            z-index: 5;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }
        .iphone-time {
            position: absolute;
            left: 25px;
        }
        .iphone-icons {
            position: absolute;
            right: 25px;
            display: flex;
            gap: 8px;
        }
        .iphone-title {
            position: absolute;
            left: 0;
            right: 0;
            text-align: center;
            font-weight: 600;
        }
        iframe {
            position: absolute;
            top: 44px;
            left: 0;
            width: 100%;
            height: calc(100% - 44px - 5px);
            border: none;
            background-color: white;
        }
        .iphone-home-indicator {
            position: absolute;
            bottom: 7px;
            left: 50%;
            transform: translateX(-50%);
            width: 30%;
            height: 5px;
            background-color: #000;
            border-radius: 3px;
            z-index: 5;
        }
        .loading {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.8);
            justify-content: center;
            align-items: center;
            z-index: 9999;
            flex-direction: column;
        }
        /* 添加返回按钮 */
        .back-button {
            background-color: #007aff;
            color: white;
            border: none;
            border-radius: 10px;
            padding: 10px 15px;
            font-size: 14px;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            margin-left: 10px;
        }
        /* 超级会员按钮 */
        .promo-button {
            background-color: #007aff;
            color: white;
            border: none;
            border-radius: 10px;
            padding: 10px 15px;
            font-size: 14px;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }
        /* 页面底部标题 */
        .page-title {
            text-align: center;
            color: #333;
            font-size: 16px;
            font-weight: bold;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <!-- 加载中提示 -->
    <div class="loading" id="loading">
        <div class="w-12 h-12 bg-blue-500 rounded-xl flex justify-center items-center mb-4">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                <rect x="2" y="5" width="20" height="14" rx="2" ry="2"></rect>
                <line x1="2" y1="10" x2="22" y2="10"></line>
            </svg>
        </div>
        <p class="text-white">页面加载中，请稍候...</p>
    </div>

    <div class="main-container">
        <!-- 顶部按钮 -->
        <div class="header-buttons">
            <button class="promo-button">超级会员权限</button>
            <button class="back-button" onclick="window.location.href='pages/home.html'">返回普通视图</button>
        </div>
        
        <!-- iPhone设备展示容器 -->
        <div class="iframe-container">
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">首页</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/home.html" title="首页" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">首页</div>
            </div>
            
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">账单</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/bills.html" title="账单" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">账单</div>
            </div>
            
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">统计</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/statistics.html" title="统计" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">统计</div>
            </div>
            
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">快速记账</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/quick-entry.html" title="快速记账" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">快速记账</div>
            </div>
            
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">分类管理</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/add-category.html" title="分类管理" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">分类管理</div>
            </div>
            
            <div class="iframe-box">
                <div class="iphone-mockup">
                    <div class="iphone-frame">
                        <div class="iphone-screen">
                            <div class="iphone-status-bar">
                                <div class="iphone-time">9:41</div>
                                <div class="iphone-title">设置</div>
                                <div class="iphone-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
                                        <path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
                                    </svg>
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
                                        <line x1="9" y1="3" x2="9" y2="21"></line>
                                    </svg>
                                </div>
                            </div>
                            <iframe src="pages/settings.html" title="设置" class="iframe-content"></iframe>
                            <div class="iphone-home-indicator"></div>
                        </div>
                    </div>
                </div>
                <div class="page-title">设置</div>
            </div>
        </div>
    </div>

    <script>
        // 显示加载指示器
        document.getElementById('loading').style.display = 'flex';
        
        // 页面完全加载后隐藏加载指示器
        window.addEventListener('load', function() {
            setTimeout(function() {
                document.getElementById('loading').style.display = 'none';
            }, 1000);
        });

        // 监听所有iframe加载完成
        let loadedIframes = 0;
        const iframes = document.querySelectorAll('iframe');
        const totalIframes = iframes.length;
        
        iframes.forEach(function(iframe) {
            iframe.addEventListener('load', function() {
                loadedIframes++;
                // 为每个iframe中的body添加iframe-view类
                try {
                    const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
                    const iframeBody = iframeDocument.body;
                    if (iframeBody) {
                        iframeBody.classList.add('iframe-view');
                    }
                } catch (e) {
                    console.error('无法访问iframe内容:', e);
                }
                
                if (loadedIframes === totalIframes) {
                    setTimeout(function() {
                        document.getElementById('loading').style.display = 'none';
                    }, 500);
                }
            });
        });
    </script>
</body>
</html> 
